import request from '@/utils/request'

/**
 * 工作汇报列表
 * @param {*} data
 */
export function executionReportPageListAPI(data) {
  return request({
    url: 'oaExecutionReport/queryPageList',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

/**
 * 汇报详情
 * @param {*} id
 */
export function executionReportDetailAPI(id) {
  return request({
    url: `oaExecutionReport/getDetail/${id}`,
    method: 'post'
  })
}

/**
 * 汇报基础信息
 * @param {*} id
 */
export function executionReportSimpleDetailAPI(id) {
  return request({
    url: `oaExecutionReport/getSimpleDetail/${id}`,
    method: 'post'
  })
}

/**
 * 新建工作汇报 - 品牌店铺
 * @param {*} data
 */
export function executionBrandReportAddAPI(data) {
  return request({
    url: 'oaExecutionReport/addBrandReport',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

/**
 * 新建工作汇报 - 新媒体
 * @param {*} data
 */
export function executionMediaReportAddAPI(data) {
  return request({
    url: 'oaExecutionReport/addMediaReport',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

/**
 * 修改工作汇报
 * @param {*} id
 */
export function executionReportUpdateAPI(data) {
  return request({
    url: `oaExecutionReport/updateReport`,
    data: data,
    method: 'post',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

/**
 * 删除汇报
 * @param {*} data
 */
export function executionReportDeleteAPI(data) {
  return request({
    url: 'oaExecutionReport/deleteByIds',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

/**
 * 获取截止上周的汇总数据
 * @param {*} data
 */
export function executionReportSummaryGetLastWeekAPI(data) {
  return request({
    url: 'oaExecutionReport/getSummaryLastWeek',
    method: 'post',
    data: data
  })
}

/**
 * 提交汇报
 * @param {*} data
 */
export function executionReportSubmitAPI(id) {
  return request({
    url: `oaExecutionReport/submit/${id}`,
    method: 'post'
  })
}

/**
 * 获取各状态数量
 * @param {*} data
 */
export function executionReportStatusNumAPI() {
  return request({
    url: `oaExecutionReport/queryStatusNum`,
    method: 'post'
  })
}
